home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!zephyr.ens.tek.com!tekred!saab!billr
- From: billr@saab.CNA.TEK.COM (Bill Randle)
- Newsgroups: comp.sources.games
- Subject: v11i095: blockbuster - clear the bricks games (SunView only), Patch1
- Message-ID: <6726@tekred.CNA.TEK.COM>
- Date: 18 Dec 90 19:01:47 GMT
- Sender: news@tekred.CNA.TEK.COM
- Lines: 1041
- Approved: billr@saab.CNA.TEK.COM
-
- Submitted-by: Eric Van Gestel <ericvg%BLEKUL60.BITNET@cunyvm.cuny.edu>
- Posting-number: Volume 11, Issue 95
- Archive-name: blockbuster/Patch1
- Patch-To: blockbuster: Volume 11, Issue 18-20
- Environment: SunView
-
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of shell archive."
- # Contents: README.PCH1 patches01
- # Wrapped by billr@saab on Tue Dec 18 10:58:46 1990
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'README.PCH1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README.PCH1'\"
- else
- echo shar: Extracting \"'README.PCH1'\" \(1094 characters\)
- sed "s/^X//" >'README.PCH1' <<'END_OF_FILE'
- XBlockbuster patch1 is largely cosmetic; it takes care of the following:
- X
- X1. Allows for 10 digit scores in stead of the current 7.
- X [Smm overflows on the maximum score for Leprechaun (wacko). Although, to
- X date, no one has actually done this, >7 digit scores have been reported.]
- X
- X2. Fixes get_playground such that it will accept sunview options if the
- X playground argument is missing, and puts it where it belongs (before main).
- X
- X3. Cleans up a number of comments rather badly maulded by the reformatter.
- X
- X4. Makes the code portable to ANSI C (thanks hugh@csri.toronto.edu).
- X
- X5. The first few stages are a bit faster
- X [the speed you would have got to after 5 stages];
- X while retaining the full effect of Pause blocks (unchanged minimum speed).
- X Now this still isn't very fast, but reserve your judgment until you've been
- X round all stages once or twice and start building up a reasonable score.
- X
- XOf course, with get_playground added by billr, there is no longer any need
- Xfor the shell script blockbuster.SKEL; so you may delete it.
- X
- X-- Eric Van Gestel (ericvg@cs.kuleuven.ac.be)
- END_OF_FILE
- if test 1094 -ne `wc -c <'README.PCH1'`; then
- echo shar: \"'README.PCH1'\" unpacked with wrong size!
- fi
- # end of 'README.PCH1'
- fi
- if test -f 'patches01' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'patches01'\"
- else
- echo shar: Extracting \"'patches01'\" \(30506 characters\)
- sed "s/^X//" >'patches01' <<'END_OF_FILE'
- X*** RATIONAL.orig Thu Aug 23 14:56:10 1990
- X--- RATIONAL Thu Aug 23 14:56:33 1990
- X***************
- X*** 7,9 ****
- X They can be modified easily, but as this makes it harder to compare scores,
- X! you should provide a separate play ground.
- X
- X--- 7,9 ----
- X They can be modified easily, but as this makes it harder to compare scores,
- X! you should provide a separate playground.
- X
- X***************
- X*** 11,14 ****
- X - blockbuster
- X! Executable for whatever host your on.
- X! (must be executed from within a play ground directory)
- X - sun3.50 & sun4
- X--- 11,13 ----
- X - blockbuster
- X! Executable for whatever host you're on.
- X - sun3.50 & sun4
- X***************
- X*** 16,18 ****
- X (no crosscompilation though, you must be on a sun3.50 or sun4
- X! respectively)
- X - stagemm
- X--- 15,17 ----
- X (no crosscompilation though, you must be on a sun3.50 or sun4
- X! respectively)
- X - stagemm
- X***************
- X*** 22,25 ****
- X (You may wish to adjust, rename and put these in your path.)
- X- - blockbuster.SKEL
- X- Main program (architecture, and directory independent)
- X - smm.SKEL
- X--- 21,22 ----
- X*** README.orig Thu Aug 23 14:56:11 1990
- X--- README Thu Aug 23 14:56:34 1990
- X***************
- X*** 20,22 ****
- X added by Bill Randle (billr@saab.CNA.TEK.COM) 9 August 1990.
- X! [The man page described the "play_ground" option, but it wasn't
- X implemented in the code until now.]
- X--- 20,22 ----
- X added by Bill Randle (billr@saab.CNA.TEK.COM) 9 August 1990.
- X! [The man page described the "playground" option, but it wasn't
- X implemented in the code until now.]
- X*** balls_pallet.c.orig Thu Aug 23 14:56:12 1990
- X--- balls_pallet.c Thu Aug 23 14:56:36 1990
- X***************
- X*** 28,33 ****
- X
- X! #define draw_ball( ball ) \
- X! /* struct Ball *ball */ \
- X! pw_rop( stage_win, (int)( (ball)->x ) - 8, (int)( (ball)->y ) - 8, 16, 16, \
- X! PIX_XOR, &ball_pr, 0, 0 )
- X
- X--- 28,33 ----
- X
- X! #define draw_ball( ball ) \
- X! /* struct Ball *ball */ \
- X! pw_rop( stage_win, (int)( (ball)->x ) - 8, (int)( (ball)->y ) - 8, \
- X! 16, 16, PIX_XOR, &ball_pr, 0, 0 )
- X
- X***************
- X*** 56,75 ****
- X PIX_XOR, 1 );
- X! pw_vector( stage_win, 0, mouse_yI - 1, /* <HC> */
- X! 10, mouse_yI - 1, /* <HC> */
- X! PIX_XOR, 1 );/* <HC> */
- X! pw_vector( stage_win, 0, mouse_yI,
- X! 10, mouse_yI,/* <HC> */
- X! PIX_XOR, 1 );/* <HC> */
- X! pw_vector( stage_win, 0, mouse_yI + 1, /* <HC> */
- X! 10, mouse_yI + 1, /* <HC> */
- X! PIX_XOR, 1 );/* <HC> */
- X! pw_vector( stage_win, STAGE_WIDTH_IN_PIXELS - 1, mouse_yI - 1, /* <HC> */
- X! STAGE_WIDTH_IN_PIXELS - 11, mouse_yI - 1, /* <HC> */
- X! PIX_XOR, 1 );/* <HC> */
- X! pw_vector( stage_win, STAGE_WIDTH_IN_PIXELS - 1, mouse_yI,
- X! STAGE_WIDTH_IN_PIXELS - 11, mouse_yI, /* <HC> */
- X! PIX_XOR, 1 );/* <HC> */
- X! pw_vector( stage_win, STAGE_WIDTH_IN_PIXELS - 1, mouse_yI + 1, /* <HC> */
- X! STAGE_WIDTH_IN_PIXELS - 11, mouse_yI + 1, /* <HC> */
- X! PIX_XOR, 1 );/* <HC> */
- X }
- X--- 56,75 ----
- X PIX_XOR, 1 );
- X! pw_vector( stage_win, 0, mouse_yI - 1, /*<HC>*/
- X! 10, mouse_yI - 1, /*<HC>*/
- X! PIX_XOR, 1 ); /*<HC>*/
- X! pw_vector( stage_win, 0, mouse_yI, /*<HC>*/
- X! 10, mouse_yI, /*<HC>*/
- X! PIX_XOR, 1 ); /*<HC>*/
- X! pw_vector( stage_win, 0, mouse_yI + 1, /*<HC>*/
- X! 10, mouse_yI + 1, /*<HC>*/
- X! PIX_XOR, 1 ); /*<HC>*/
- X! pw_vector( stage_win, STAGE_WIDTH_IN_PIXELS - 1, mouse_yI - 1, /*<HC>*/
- X! STAGE_WIDTH_IN_PIXELS - 11, mouse_yI - 1, /*<HC>*/
- X! PIX_XOR, 1 ); /*<HC>*/
- X! pw_vector( stage_win, STAGE_WIDTH_IN_PIXELS - 1, mouse_yI, /*<HC>*/
- X! STAGE_WIDTH_IN_PIXELS - 11, mouse_yI, /*<HC>*/
- X! PIX_XOR, 1 ); /*<HC>*/
- X! pw_vector( stage_win, STAGE_WIDTH_IN_PIXELS - 1, mouse_yI + 1, /*<HC>*/
- X! STAGE_WIDTH_IN_PIXELS - 11, mouse_yI + 1, /*<HC>*/
- X! PIX_XOR, 1 ); /*<HC>*/
- X }
- X***************
- X*** 133,135 ****
- X ball->speed = launch_speed;
- X! ball->x_speed = launch_speed * ( ( ball->quadrant == NE ) ? M_SQRT2_2
- X /* NW */ : -M_SQRT2_2 );
- X--- 133,136 ----
- X ball->speed = launch_speed;
- X! ball->x_speed = launch_speed *
- X! ( ( ball->quadrant == NE ) ? M_SQRT2_2
- X /* NW */ : -M_SQRT2_2 );
- X***************
- X*** 195,200 ****
- X if ( !( ++loop_nhits % LOOP_MAX ) )
- X! ball->x -=
- X! ball->x_speed * ( double ) ( loop_nhits / LOOP_MAX ) + 1;
- X /* horizontal shift, trying to get out of a bounce loop */
- X! /* negative to try to avoid leaving the stage */
- X break;
- X--- 196,200 ----
- X if ( !( ++loop_nhits % LOOP_MAX ) )
- X! ball->x -= ball->x_speed * ( double ) ( loop_nhits / LOOP_MAX ) + 1;
- X /* horizontal shift, trying to get out of a bounce loop */
- X! /* negative to avoid leaving the stage at the side */
- X break;
- X***************
- X*** 265,268 ****
- X ball->y_speed *= pause;
- X }
- X- /* approximative; will be corrected on next pallet deflection */
- X show_speeds( );
- X--- 265,271 ----
- X ball->y_speed *= pause;
- X+ /*
- X+ * approximative; will be corrected on next pallet
- X+ * deflection
- X+ */
- X }
- X show_speeds( );
- X***************
- X*** 305,307 ****
- X if ( ++( brick->nhits ) == 8 ) {
- X! launch_speed -= ( launch_speed - INIT_SPEED ) * 0.3;
- X busted = TRUE;
- X--- 308,310 ----
- X if ( ++( brick->nhits ) == 8 ) {
- X! launch_speed -= ( launch_speed - MIN_SPEED ) * 0.3;
- X busted = TRUE;
- X***************
- X*** 320,327 ****
- X * note no check for NEAR_HORIZONTAL and none needed
- X! * since,
- X */
- X- /*
- X- * if it gets too horizontal, it probably will hit it
- X- * again.
- X- */
- X }
- X--- 323,327 ----
- X * note no check for NEAR_HORIZONTAL and none needed
- X! * since, if it gets too horizontal, it probably will
- X! * hit it again.
- X */
- X }
- X***************
- X*** 332,336 ****
- X ball->x_speed += ( ball->x_speed < 0 ) ? -SPEED_INCR_2
- X! : SPEED_INCR_2;
- X ball->y_speed += ( ball->y_speed < 0 ) ? -SPEED_INCR_2
- X! : SPEED_INCR_2;
- X /*
- X--- 332,336 ----
- X ball->x_speed += ( ball->x_speed < 0 ) ? -SPEED_INCR_2
- X! : SPEED_INCR_2;
- X ball->y_speed += ( ball->y_speed < 0 ) ? -SPEED_INCR_2
- X! : SPEED_INCR_2;
- X /*
- X***************
- X*** 349,351 ****
- X break;
- X! case 'U': /* undo */ ;
- X /* effective only after something has been busted */
- X--- 349,351 ----
- X break;
- X! case 'U': /* undo */ ;
- X /* effective only after something has been busted */
- X***************
- X*** 360,366 ****
- X break;
- X! case 'W': /* open window */ ;
- X brick->code = '%';
- X! /* redraw = TRUE */ draw_brick( ball->row, ball->col );
- X return ( score_hit ); /* no deflection */
- X! case '%': /* closed window */ ;
- X brick->code = 'W';
- X--- 360,366 ----
- X break;
- X! case 'W': /* open window */ ;
- X brick->code = '%';
- X! /* redraw = TRUE; */ draw_brick( ball->row, ball->col );
- X return ( score_hit ); /* no deflection */
- X! case '%': /* closed window */ ;
- X brick->code = 'W';
- X***************
- X*** 576,578 ****
- X for ( tmp = 0; tmp < MSG_HEIGHT; tmp++ )
- X! pw_vector( msg_win, 0, tmp, STAGE_WIDTH_IN_PIXELS - 1, tmp,
- X PIX_CLR, 1 );
- X--- 576,579 ----
- X for ( tmp = 0; tmp < MSG_HEIGHT; tmp++ )
- X! pw_vector( msg_win, 0, tmp,
- X! STAGE_WIDTH_IN_PIXELS - 1, tmp,
- X PIX_CLR, 1 );
- X***************
- X*** 584,586 ****
- X /* lets go ! */
- X! move_balls( ); /* starts the timer */
- X break;
- X--- 585,587 ----
- X /* lets go ! */
- X! move_balls( ( Frame ) NULL, 0 ); /* starts the timer */
- X break;
- X***************
- X*** 596,598 ****
- X pallet_x = ( double ) ( pallet_xI = event_x( event ) );
- X! mouse_yI = event_y( event ); /* <HC> */
- X }
- X--- 597,599 ----
- X pallet_x = ( double ) ( pallet_xI = event_x( event ) );
- X! mouse_yI = event_y( event ); /*<HC>*/
- X }
- X*** blockbuster.c.orig Thu Aug 23 14:56:13 1990
- X--- blockbuster.c Thu Aug 23 14:56:39 1990
- X***************
- X*** 27,29 ****
- X
- X! DEFINE_ICON_FROM_IMAGE( blockbuster_icon, blockbuster_icon_image );
- X
- X--- 27,29 ----
- X
- X! DEFINE_ICON_FROM_IMAGE( blockbuster_icon, blockbuster_icon_image )
- X
- X***************
- X*** 30,32 ****
- X--- 30,65 ----
- X
- X+ /*** [ANSI] define globals (declared external in blockbuster.h) ***/
- X+ Frame frame;
- X+ Canvas stage_cvs, msg_cvs;
- X+ Pixwin *stage_win, *msg_win;
- X+ Pixfont *font;
- X+ char msg0_buf[55];
- X+ struct Brick stage[MAX_ROW + 1][MAX_COL + 1];
- X+ struct Ball ball1, ball2, ball3;
- X+ int launch_quadrant; /* enumeration { NE, NW } */
- X+ int launch_row, launch_col;
- X+ double launch_x, launch_y;
- X+ int emit_row, emit_col;
- X+ int pallet_lengthI; /* range MIN_PALLET_LENGTH..MAX_PALLET_LENGTH */
- X+ int pallet_heightI; /* range pallet_lengthI..MAX_PALLET_HEIGHT */
- X+ int pallet_xI; /* range 0..STAGE_WIDTH_IN_PIXELS */
- X+ int pallet_yI; /* range PALLET_MAX_Y+4..PALLET_MIN_Y-12 */
- X+ int pallet_row; /* range MAX_ROW-1..MAX_ROW-9 */
- X+ double pallet_length, pallet_height, pallet_x, pallet_y;
- X+ int mouse_yI; /* range 0..STAGE_HEIGHT_IN_PIXELS */ /*<HC>*/
- X+ int nb_stages, stage_nb, balls_left, score, score_incr, nbricks,
- X+ loop_nhits, pallet_modif;
- X+ double launch_speed;
- X+ char stage_name[NAME_LENGTH];
- X+ int stages[MAX_NB_STAGES];
- X+ struct Brick *last_busted_brick; /* NULL == none so far */
- X+ char last_busted_code;
- X+ int last_busted_row, last_busted_col;
- X+ struct itimerval timeout;
- X+ char *login;
- X+ char playground[PATH_LENGTH];
- X+
- X+
- X /*** signal handling ***/
- X+ void
- X catch( sig )
- X***************
- X*** 87,88 ****
- X--- 120,181 ----
- X
- X+ /*** pathname of playground; anonymous, named or private ***/
- X+ void
- X+ get_playground( argc, argv )
- X+ int argc;
- X+ char *argv[];
- X+ {
- X+ DIR *dirp;
- X+ struct direct *dp;
- X+ struct stat st;
- X+ int len, found = FALSE;
- X+
- X+ /* set default playground directory */
- X+ strcpy( playground, STAGEDIR );
- X+ strcat( playground, "/STAGES" );
- X+ /* check for additional arguments (specific playground) */
- X+ if ( argc > 1 ) {
- X+ len = strlen( argv[1] );
- X+ if ( argv[1][0] == '-' ) {
- X+ if ( len > 1 ) {
- X+ /* sunview_options only */
- X+ return;
- X+ }
- X+ /* list available playgrounds */
- X+ printf( "available playgrounds are:\n" );
- X+ printf( "\tdefault\n" );
- X+ dirp = opendir( STAGEDIR );
- X+ for( dp = readdir( dirp ); dp != NULL;
- X+ dp = readdir( dirp ) ) {
- X+ if ( !strncmp( dp->d_name, "STAGES.", 7 ) )
- X+ printf( "\t%s\n", ( dp->d_name ) + 7 );
- X+ }
- X+ closedir( dirp );
- X+ exit( 0 );
- X+ }
- X+ /* it's a playground name or private directory */
- X+ if( !strcmp( argv[1], "default" ) ) {
- X+ /* just in case someone used default */
- X+ return;
- X+ }
- X+ dirp = opendir( STAGEDIR );
- X+ for( dp = readdir( dirp ); dp != NULL; dp = readdir( dirp ) ) {
- X+ if ( dp->d_namlen == len + 7 &&
- X+ !strcmp( ( dp->d_name ) + 7, argv[1] ) ) {
- X+ strcat( playground, ( dp->d_name ) + 6 );
- X+ return;
- X+ }
- X+ }
- X+ closedir( dirp );
- X+ /* it's a private directory */
- X+ strcpy( playground, argv[1] );
- X+ stat( playground, &st );
- X+ if( !(st.st_mode & S_IFDIR) ) {
- X+ printf( "private playground <%s> not a directory.\n",
- X+ playground );
- X+ exit( 1 );
- X+ }
- X+ }
- X+ }
- X+
- X+
- X /*** blockbuster ***/
- X***************
- X*** 94,97 ****
- X Cursor cursor;
- X- FILE *fd;
- X- int crosshairs = FALSE;
- X
- X--- 187,188 ----
- X***************
- X*** 138,145 ****
- X CURSOR_SHOW_CURSOR, FALSE,
- X! /*
- X! * CURSOR_SHOW_HORIZ_HAIR, TRUE, CURSOR_HORIZ_HAIR_LENGTH, 12,
- X! * CURSOR_HORIZ_HAIR_THICKNESS, 3, CURSOR_HORIZ_HAIR_BORDER_GRAVITY,
- X! * TRUE, ** for some reason this won't work *** ** WORKAROUND: q.v.
- X! * balls_pallet.c **
- X! *//* <HC> */
- X 0 );
- X--- 229,236 ----
- X CURSOR_SHOW_CURSOR, FALSE,
- X! /**CURSOR_SHOW_HORIZ_HAIR, TRUE,
- X! **CURSOR_HORIZ_HAIR_LENGTH, 12,
- X! **CURSOR_HORIZ_HAIR_THICKNESS, 3,
- X! **CURSOR_HORIZ_HAIR_BORDER_GRAVITY, TRUE,
- X! *** for some reason this won't work ***
- X! *** WORKAROUND <HC>: q.v. balls_pallet.c ***/
- X 0 );
- X***************
- X*** 165,226 ****
- X exit( 0 );
- X- }
- X-
- X- get_playground( argc, argv )
- X- int argc;
- X- char *argv[];
- X- {
- X- DIR *dirp;
- X- struct direct *dp;
- X- struct stat st;
- X- int len, found;
- X-
- X- /* set default playground directory */
- X- strcpy( playground, STAGEDIR );
- X- strcat( playground, "/" );
- X- /* check for additional arguments (specific playground) */
- X- if ( argc > 1 ) {
- X- if ( argv[1][0] == '-' ) {
- X- /* list available playgrounds */
- X- printf( "available playgrounds are:\n" );
- X- printf( "\tdefault\n" );
- X- dirp = opendir(STAGEDIR);
- X- for( dp=readdir( dirp ); dp!=NULL; dp=readdir( dirp ) ) {
- X- if ( !strncmp( dp->d_name, "STAGES.", 7 ) )
- X- printf( "\t%s\n", (dp->d_name)+7 );
- X- }
- X- closedir( dirp );
- X- exit( 0 );
- X- }
- X- /* it's a playground name or private directory */
- X- if( !strcmp( argv[1], "default" ) ) {
- X- /* just in case someone used default */
- X- strcat( playground, "STAGES" );
- X- return;
- X- }
- X- found = 0;
- X- len = strlen( argv[1] );
- X- dirp = opendir( STAGEDIR );
- X- for( dp=readdir( dirp ); dp!=NULL; dp=readdir( dirp ) ) {
- X- if ( dp->d_namlen == len+7 &&
- X- !strcmp( (dp->d_name)+7, argv[1] ) ) {
- X- found++;
- X- break;
- X- }
- X- }
- X- closedir( dirp );
- X- if ( found )
- X- strcat( playground, dp->d_name );
- X- else {
- X- /* private dir */
- X- strcpy( playground, argv[1] );
- X- stat( playground, &st );
- X- if( !(st.st_mode & S_IFDIR) ) {
- X- printf( "private playground <%s> not a directory.\n",
- X- playground );
- X- exit( 1 );
- X- }
- X- }
- X- } else {
- X- strcat( playground, "STAGES" );
- X- }
- X }
- X--- 256,257 ----
- X*** blockbuster.h.orig Thu Aug 23 14:56:15 1990
- X--- blockbuster.h Thu Aug 23 15:22:25 1990
- X***************
- X*** 7,9 ****
- X * Compilation:
- X! * -lsuntool -lsunwindow -lpixrect
- X */
- X--- 7,9 ----
- X * Compilation:
- X! * -lsuntool -lsunwindow -lpixrect -lm
- X */
- X***************
- X*** 13,14 ****
- X--- 13,15 ----
- X #include <stdio.h>
- X+ #include <string.h>
- X #include <pwd.h>
- X***************
- X*** 21,23 ****
- X /*
- X! * #define M_PI 3.14159265358979323846
- X * #define M_PI_2 1.57079632679489661923
- X--- 22,24 ----
- X /*
- X! * #define M_PI 3.14159265358979323846
- X * #define M_PI_2 1.57079632679489661923
- X***************
- X*** 35,38 ****
- X
- X! #define MAX_ROW 42
- X! #define MAX_COL 11
- X
- X--- 36,39 ----
- X
- X! #define MAX_ROW 42
- X! #define MAX_COL 11
- X
- X***************
- X*** 51,56 ****
- X
- X! Frame frame;
- X! Canvas stage_cvs, msg_cvs;
- X! Pixwin *stage_win, *msg_win;
- X! Pixfont *font;
- X
- X--- 52,57 ----
- X
- X! extern Frame frame;
- X! extern Canvas stage_cvs, msg_cvs;
- X! extern Pixwin *stage_win, *msg_win;
- X! extern Pixfont *font;
- X
- X***************
- X*** 67,69 ****
- X
- X! char msg0_buf[55];
- X
- X--- 68,70 ----
- X
- X! extern char msg0_buf[55];
- X
- X***************
- X*** 105,109 ****
- X #define INIT_BALLS 3
- X! #define LOOP_MAX 100
- X
- X! #define INIT_SPEED 3.0
- X #define MAX_SPEED 8.0
- X--- 106,111 ----
- X #define INIT_BALLS 3
- X! #define LOOP_MAX 97 /* prime by wish, not need */
- X
- X! #define MIN_SPEED 3.0
- X! #define INIT_SPEED 4.0
- X #define MAX_SPEED 8.0
- X***************
- X*** 113,121 ****
- X #define SPEED_RESOLUTION 60 /* SPEED_LIMIT / SPEED_INCR */
- X! #define SPEED_RESOLUTION_FACTOR 5.0 /* SPEED_RESOLUTION /
- X! * SPEED_LIMI
- X! *
- X! /* the stage is a two
- X! * dimensional array of
- X! * bricks */
- X! struct Brick {
- X char code; /* Q.V. map_codes */
- X--- 115,120 ----
- X #define SPEED_RESOLUTION 60 /* SPEED_LIMIT / SPEED_INCR */
- X! #define SPEED_RESOLUTION_FACTOR 5.0 /* SPEED_RESOLUTION / SPEED_LIMIT */
- X!
- X! /* the stage is a two dimensional array of bricks */
- X! extern struct Brick {
- X char code; /* Q.V. map_codes */
- X***************
- X*** 126,128 ****
- X
- X! struct Ball {
- X int quadrant; /* enumeration { NO_BALL, NE, NW, SW,
- X--- 125,127 ----
- X
- X! extern struct Ball {
- X int quadrant; /* enumeration { NO_BALL, NE, NW, SW,
- X***************
- X*** 129,137 ****
- X * SE } */
- X! double angle; /* range -M_PI_4..NEAR_HORIZONTAL */
- X! /*
- X! * NW -P4|-P4 NE +NH | +NH >>>>>>+<<<<<< (gap to avoid infinite
- X! * horizontal bounce loops) +NH | +NH SW -P4|-P4 SE
- X! */
- X int row, col; /* coordinates on the stage */
- X! double x, y; /* coordinates in pixels */
- X double speed, x_speed, y_speed; /* motion per update in
- X--- 128,139 ----
- X * SE } */
- X! double angle; /* range -M_PI_4..NEAR_HORIZONTAL */
- X! /**
- X! ** NW -P4|-P4 NE
- X! ** +NH | +NH
- X! ** >>>>>>+<<<<<< (gap to avoid infinite horizontal bounce loops)
- X! ** +NH | +NH
- X! ** SW -P4|-P4 SE
- X! **/
- X int row, col; /* coordinates on the stage */
- X! double x, y; /* coordinates in pixels */
- X double speed, x_speed, y_speed; /* motion per update in
- X***************
- X*** 138,143 ****
- X * pixels */
- X! /*
- X! * INVARIANT: x_speed == speed * cos( true_angle ) y_speed == speed *
- X! * sin( true_angle )
- X! */
- X } ball1, ball2, ball3;
- X--- 140,146 ----
- X * pixels */
- X! /**
- X! ** INVARIANT:
- X! ** x_speed == speed * cos( true_angle )
- X! ** y_speed == speed * sin( true_angle )
- X! **/
- X } ball1, ball2, ball3;
- X***************
- X*** 144,149 ****
- X
- X! int launch_quadrant;/* enumeration { NE, NW } */
- X! int launch_row, launch_col;
- X! double launch_x, launch_y;
- X! int emit_row, emit_col;
- X
- X--- 147,152 ----
- X
- X! extern int launch_quadrant; /* enumeration { NE, NW } */
- X! extern int launch_row, launch_col;
- X! extern double launch_x, launch_y;
- X! extern int emit_row, emit_col;
- X
- X***************
- X*** 159,166 ****
- X
- X! int pallet_lengthI; /* range MIN_PALLET_LENGTH..MAX_PALLET_LENGTH */
- X! int pallet_heightI; /* range pallet_lengthI..MAX_PALLET_HEIGHT */
- X! int pallet_xI; /* range 0..STAGE_WIDTH_IN_PIXELS */
- X! int pallet_yI; /* range PALLET_MAX_Y+4..PALLET_MIN_Y-12 */
- X! int pallet_row; /* range MAX_ROW-1..MAX_ROW-9 */
- X! double pallet_length, pallet_height, pallet_x, pallet_y;
- X
- X--- 162,169 ----
- X
- X! extern int pallet_lengthI; /* range MIN_PALLET_LENGTH..MAX_PALLET_LENGTH */
- X! extern int pallet_heightI; /* range pallet_lengthI..MAX_PALLET_HEIGHT */
- X! extern int pallet_xI; /* range 0..STAGE_WIDTH_IN_PIXELS */
- X! extern int pallet_yI; /* range PALLET_MAX_Y+4..PALLET_MIN_Y-12 */
- X! extern int pallet_row; /* range MAX_ROW-1..MAX_ROW-9 */
- X! extern double pallet_length, pallet_height, pallet_x, pallet_y;
- X
- X***************
- X*** 173,178 ****
- X */
- X! int mouse_yI; /* range 0..STAGE_HEIGHT_IN_PIXELS *//* <HC> */
- X
- X! int nb_stages, stage_nb, balls_left, score, score_incr, nbricks, loop_nhits, pallet_modif;
- X! double launch_speed;
- X
- X--- 176,182 ----
- X */
- X! extern int mouse_yI; /* range 0..STAGE_HEIGHT_IN_PIXELS */ /*<HC>*/
- X
- X! extern int nb_stages, stage_nb, balls_left, score, score_incr, nbricks,
- X! loop_nhits, pallet_modif;
- X! extern double launch_speed;
- X
- X***************
- X*** 179,181 ****
- X #define NAME_LENGTH 20
- X! char stage_name[NAME_LENGTH];
- X
- X--- 183,185 ----
- X #define NAME_LENGTH 20
- X! extern char stage_name[NAME_LENGTH];
- X
- X***************
- X*** 182,188 ****
- X #define MAX_NB_STAGES 100
- X! int stages[MAX_NB_STAGES];
- X
- X! struct Brick *last_busted_brick; /* NULL == none so far */
- X! char last_busted_code;
- X! int last_busted_row, last_busted_col;
- X
- X--- 186,192 ----
- X #define MAX_NB_STAGES 100
- X! extern int stages[MAX_NB_STAGES];
- X
- X! extern struct Brick *last_busted_brick; /* NULL == none so far */
- X! extern char last_busted_code;
- X! extern int last_busted_row, last_busted_col;
- X
- X***************
- X*** 191,194 ****
- X
- X! Notify_value move_balls( ); /* => timeout events */
- X! int move_pallet( );/* => LOC_MOVE events */
- X
- X--- 195,198 ----
- X
- X! extern Notify_value move_balls( ); /* => timeout events */
- X! extern int move_pallet( ); /* => LOC_MOVE events */
- X
- X***************
- X*** 197,199 ****
- X
- X! struct itimerval timeout;
- X
- X--- 201,203 ----
- X
- X! extern struct itimerval timeout;
- X
- X***************
- X*** 204,206 ****
- X (void) notify_set_itimer_func( frame, move_balls, \
- X! ITIMER_REAL, &timeout, ITIMER_NULL )
- X #define stop_timer() \
- X--- 208,210 ----
- X (void) notify_set_itimer_func( frame, move_balls, \
- X! ITIMER_REAL, &timeout, ITIMER_NULL )
- X #define stop_timer() \
- X***************
- X*** 207,209 ****
- X (void) notify_set_itimer_func( frame, move_balls, \
- X! ITIMER_REAL, ITIMER_NULL, ITIMER_NULL )
- X
- X--- 211,213 ----
- X (void) notify_set_itimer_func( frame, move_balls, \
- X! ITIMER_REAL, ITIMER_NULL, ITIMER_NULL )
- X
- X***************
- X*** 214,217 ****
- X
- X! char *login;
- X! char playground[PATH_LENGTH];
- X
- X--- 218,221 ----
- X
- X! extern char *login;
- X! extern char playground[PATH_LENGTH];
- X
- X*** blockbuster.man.orig Thu Aug 23 14:56:16 1990
- X--- blockbuster.man Thu Aug 23 14:56:43 1990
- X***************
- X*** 6,8 ****
- X .B blockbuster
- X! .I [play_ground]
- X .I [sunview_options]
- X--- 6,8 ----
- X .B blockbuster
- X! .I [playground]
- X .I [sunview_options]
- X***************
- X*** 9,14 ****
- X .SH DESCRIPTION
- X! The play ground is either the anonymous public play ground (no argument),
- X a named public playground or a privately owned directory.
- X! The list of available named public play grounds is obtained by giving "-"
- X! as the play ground argument.
- X .LP
- X--- 9,14 ----
- X .SH DESCRIPTION
- X! The playground is either the anonymous public playground (no argument),
- X a named public playground or a privately owned directory.
- X! The list of available named public playgrounds is obtained by giving "-"
- X! as the playground argument.
- X .LP
- X***************
- X*** 89,91 ****
- X .SH "CREATION OF PLAY GROUNDS"
- X! A private play ground can be created in any directory.
- X The stages can be defined from the ascii map codes using any text editor
- X--- 89,91 ----
- X .SH "CREATION OF PLAY GROUNDS"
- X! A private playground can be created in any directory.
- X The stages can be defined from the ascii map codes using any text editor
- X***************
- X*** 96,98 ****
- X .LP
- X! Individual stages can be tried in the public play ground "try" (q.v. 'try'),
- X provided you have write access.
- X--- 96,98 ----
- X .LP
- X! Individual stages can be tried in the public playground "try" (q.v. 'try'),
- X provided you have write access.
- X***************
- X*** 183,189 ****
- X .SH FILES
- X! {BBexe}/blockbuster.*.exe\h'|30m'executables (per architecture)
- X! {BBexe}/stagemm.exe\h'|30m'[optional] bookkeeping program (q.v. 'smm')
- X {BBstg}/stage.skel\h'|30m'skeleton stage (q.v. 'tes')
- X! {BBstg}/STAGES.\h'|30m'anonymous public play ground
- X! {BBstg}/STAGES.*\h'|30m'named public play grounds
- X \h'|30m'(including a try out environment) (q.v. 'try')
- X--- 183,189 ----
- X .SH FILES
- X! {BBexe}/blockbuster\h'|30m'executable (to be installed)
- X! {BBexe}/stagemm\h'|30m'[optional] bookkeeping program (q.v. 'smm')
- X {BBstg}/stage.skel\h'|30m'skeleton stage (q.v. 'tes')
- X! {BBstg}/STAGES.\h'|30m'anonymous public playground
- X! {BBstg}/STAGES.*\h'|30m'named public playgrounds
- X \h'|30m'(including a try out environment) (q.v. 'try')
- X***************
- X*** 190,192 ****
- X .SH "USEFUL AUXILIARY SHELLSCRIPTS"
- X- \&'blockbuster'
- X \&'smm'\h'|6m'stage mini-max (small bookkeeping program)
- X--- 190,191 ----
- X***************
- X*** 193,195 ****
- X \&'tes'\h'|6m'tuned textedit
- X! \&'try'\h'|6m'try out any individual stage in any play ground
- X \h'|6m'(using {BBstg}/STAGES.try)
- X--- 192,194 ----
- X \&'tes'\h'|6m'tuned textedit
- X! \&'try'\h'|6m'try out any individual stage in any playground
- X \h'|6m'(using {BBstg}/STAGES.try)
- X*** deflection.c.orig Thu Aug 23 14:56:17 1990
- X--- deflection.c Thu Aug 23 14:56:44 1990
- X***************
- X*** 73,75 ****
- X ball->quadrant = ( ball->quadrant == SW ) ? NW
- X! /* SE */ : NE;
- X else { /* rebound */
- X--- 73,75 ----
- X ball->quadrant = ( ball->quadrant == SW ) ? NW
- X! /* SE */ : NE;
- X else { /* rebound */
- X***************
- X*** 77,79 ****
- X ball->quadrant = ( ball->quadrant == SW ) ? NE
- X! /* SE */ : NW;
- X };
- X--- 77,79 ----
- X ball->quadrant = ( ball->quadrant == SW ) ? NE
- X! /* SE */ : NW;
- X };
- X***************
- X*** 88,90 ****
- X true_angle = ( ball->quadrant == NE ) ? M_PI_4 - ball->angle
- X! /* NW */ : M_PI_3_4 + ball->angle;
- X ball->x_speed = ball->speed * cos( true_angle );
- X--- 88,90 ----
- X true_angle = ( ball->quadrant == NE ) ? M_PI_4 - ball->angle
- X! /* NW */ : M_PI_3_4 + ball->angle;
- X ball->x_speed = ball->speed * cos( true_angle );
- X***************
- X*** 108,110 ****
- X ball1.angle < -45 || ball1.angle > 45 ||
- X! ball1.x < -pallet_length || ball1.x > pallet_length )
- X break;
- X--- 108,111 ----
- X ball1.angle < -45 || ball1.angle > 45 ||
- X! ball1.x < -pallet_length ||
- X! ball1.x > pallet_length )
- X break;
- X***************
- X*** 116,117 ****
- X }
- X! #endif DEBUG_PDEFL
- X--- 117,118 ----
- X }
- X! #endif /* DEBUG_PDEFL */
- X*** score.c.orig Thu Aug 23 14:56:18 1990
- X--- score.c Thu Aug 23 14:56:46 1990
- X***************
- X*** 60,65 ****
- X if ( score_board[lows].score > score ) {
- X! /*
- X! * an older incomplete game: complete
- X! * it
- X! */
- X score_board[lows].balls_left *= -1;
- X--- 60,62 ----
- X if ( score_board[lows].score > score ) {
- X! /* an older incomplete game */
- X score_board[lows].balls_left *= -1;
- X***************
- X*** 107,109 ****
- X if ( score_board[s].balls_left > 99 ) {
- X! msg( s + 2, sprintf( buf, "%7d (%3d) %8s ",
- X score_board[s].score,
- X--- 104,106 ----
- X if ( score_board[s].balls_left > 99 ) {
- X! msg( s + 2, sprintf( buf, "%10d (%3d) %8s ",
- X score_board[s].score,
- X***************
- X*** 112,114 ****
- X } else if ( score_board[s].balls_left > 9 ) {
- X! msg( s + 2, sprintf( buf, "%7d (%2d) %8s ",
- X score_board[s].score,
- X--- 109,111 ----
- X } else if ( score_board[s].balls_left > 9 ) {
- X! msg( s + 2, sprintf( buf, "%10d (%2d) %8s ",
- X score_board[s].score,
- X***************
- X*** 117,119 ****
- X } else if ( score_board[s].balls_left > 0 ) {
- X! msg( s + 2, sprintf( buf, "%7d (%1d) %8s ",
- X score_board[s].score,
- X--- 114,116 ----
- X } else if ( score_board[s].balls_left > 0 ) {
- X! msg( s + 2, sprintf( buf, "%10d (%1d) %8s ",
- X score_board[s].score,
- X***************
- X*** 122,124 ****
- X } else if ( score_board[s].balls_left < -99 ) {
- X! msg( s + 2, sprintf( buf, "%7d (%3d) + %8s ",
- X score_board[s].score,
- X--- 119,121 ----
- X } else if ( score_board[s].balls_left < -99 ) {
- X! msg( s + 2, sprintf( buf, "%10d (%3d) + %8s ",
- X score_board[s].score,
- X***************
- X*** 127,129 ****
- X } else if ( score_board[s].balls_left < -9 ) {
- X! msg( s + 2, sprintf( buf, "%7d (%2d) + %8s ",
- X score_board[s].score,
- X--- 124,126 ----
- X } else if ( score_board[s].balls_left < -9 ) {
- X! msg( s + 2, sprintf( buf, "%10d (%2d) + %8s ",
- X score_board[s].score,
- X***************
- X*** 132,134 ****
- X } else if ( score_board[s].balls_left < 0 ) {
- X! msg( s + 2, sprintf( buf, "%7d (%1d) + %8s ",
- X score_board[s].score,
- X--- 129,131 ----
- X } else if ( score_board[s].balls_left < 0 ) {
- X! msg( s + 2, sprintf( buf, "%10d (%1d) + %8s ",
- X score_board[s].score,
- X***************
- X*** 137,139 ****
- X } else { /* no balls left */
- X! msg( s + 2, sprintf( buf, "%7d %8s ",
- X score_board[s].score,
- X--- 134,136 ----
- X } else { /* no balls left */
- X! msg( s + 2, sprintf( buf, "%10d %8s ",
- X score_board[s].score,
- X***************
- X*** 145,156 ****
- X if ( balls_left > 99 ) {
- X! msg( NB_SCORES + 3, sprintf( buf, "%7d (%3d) %8s ",
- X! score, balls_left, login ) );
- X } else if ( balls_left > 9 ) {
- X! msg( NB_SCORES + 3, sprintf( buf, "%7d (%2d) %8s ",
- X! score, balls_left, login ) );
- X } else if ( balls_left ) {
- X! msg( NB_SCORES + 3, sprintf( buf, "%7d (%1d) %8s ",
- X! score, balls_left, login ) );
- X } else { /* no balls left */
- X! msg( NB_SCORES + 3, sprintf( buf, "%7d <> %8s ",
- X score, login ) );
- X--- 142,153 ----
- X if ( balls_left > 99 ) {
- X! msg( NB_SCORES + 3, sprintf( buf, "%10d (%3d) %8s ",
- X! score, balls_left, login ) );
- X } else if ( balls_left > 9 ) {
- X! msg( NB_SCORES + 3, sprintf( buf, "%10d (%2d) %8s ",
- X! score, balls_left, login ) );
- X } else if ( balls_left ) {
- X! msg( NB_SCORES + 3, sprintf( buf, "%10d (%1d) %8s ",
- X! score, balls_left, login ) );
- X } else { /* no balls left */
- X! msg( NB_SCORES + 3, sprintf( buf, "%10d <> %8s ",
- X score, login ) );
- X*** stagemm.c.orig Fri Aug 24 14:19:00 1990
- X--- stagemm.c Thu Aug 23 18:04:19 1990
- X***************
- X*** 13,14 ****
- X--- 13,47 ----
- X
- X+ /*** [ANSI] define globals (declared external in blockbuster.h) ***/
- X+ Frame frame;
- X+ Canvas stage_cvs, msg_cvs;
- X+ Pixwin *stage_win, *msg_win;
- X+ Pixfont *font;
- X+ char msg0_buf[55];
- X+ struct Brick stage[MAX_ROW + 1][MAX_COL + 1];
- X+ struct Ball ball1, ball2, ball3;
- X+ int launch_quadrant; /* enumeration { NE, NW } */
- X+ int launch_row, launch_col;
- X+ double launch_x, launch_y;
- X+ int emit_row, emit_col;
- X+ int pallet_lengthI; /* range MIN_PALLET_LENGTH..MAX_PALLET_LENGTH */
- X+ int pallet_heightI; /* range pallet_lengthI..MAX_PALLET_HEIGHT */
- X+ int pallet_xI; /* range 0..STAGE_WIDTH_IN_PIXELS */
- X+ int pallet_yI; /* range PALLET_MAX_Y+4..PALLET_MIN_Y-12 */
- X+ int pallet_row; /* range MAX_ROW-1..MAX_ROW-9 */
- X+ double pallet_length, pallet_height, pallet_x, pallet_y;
- X+ int mouse_yI; /* range 0..STAGE_HEIGHT_IN_PIXELS */ /*<HC>*/
- X+ int nb_stages, stage_nb, balls_left, score, score_incr, nbricks,
- X+ loop_nhits, pallet_modif;
- X+ double launch_speed;
- X+ char stage_name[NAME_LENGTH];
- X+ int stages[MAX_NB_STAGES];
- X+ struct Brick *last_busted_brick; /* NULL == none so far */
- X+ char last_busted_code;
- X+ int last_busted_row, last_busted_col;
- X+ struct itimerval timeout;
- X+ char *login;
- X+ char playground[PATH_LENGTH];
- X+
- X+
- X+ /*** stagemm ***/
- X void
- END_OF_FILE
- if test 30506 -ne `wc -c <'patches01'`; then
- echo shar: \"'patches01'\" unpacked with wrong size!
- fi
- # end of 'patches01'
- fi
- echo shar: End of shell archive.
- exit 0
-